<script>
layui.use(['jquery', 'form', 'layedit'], function(){
	var $ = layui.jquery, form = layui.form, layedit = layui.layedit;
	//自定义验证规则
	form.verify({
		name : function(value, item) {
			if (value.length < 2 || value.length > 50) {
				return '名称必须2到50字符';
			}
		}
	});
});
</script>